package cn.itzzx.lagou.mybatis.session;

import java.beans.IntrospectionException;
import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.util.List;

/**
 * 通过CRUD
 * @author Martin
 * @date 2020-04-25
 * @see 1.0
 */
public interface SqlSession {

    <E> List<E> selectList(String statementId , Object...parameter) throws SQLException, ClassNotFoundException, InvocationTargetException, IntrospectionException, InstantiationException, IllegalAccessException;

    <E> E selectOne(String statementId,Object... parameter) throws IllegalAccessException, IntrospectionException, InstantiationException, SQLException, InvocationTargetException, ClassNotFoundException;

    int update(String statement, Object... parameter) throws Exception;

    /**
     * 通过 getMapper 方式实现增删改查操作
     * @param mapperClass
     * @param <T>
     * @return
     */
    <T> T getMapper(Class<?> mapperClass);

}
